#include "user.h"

User::User(Username* us, Profilo* prof): u(us), p(prof){}

User::~User(){
    cout<<"~User"<<endl;
    delete u;
    delete p;
    //QVector<Contatto*> collegamenti
    for(int i=0;i!=collegamenti.size();i++){
        delete collegamenti[i];
    }
    //QVector<Gruppo*> gruppi
    for(int i=0;i!=gruppi.size();i++){
        delete gruppi[i];
    }
}

QString User::getNick() const{
    return u->getUsn();
}

QString User::getPwd() const{
    return u->getPwd();
}

QString User::getNome() const{
    return u->getN();
}

QString User::getCognome() const{
    return u->getC();
}

int User::getGender() const{
    return u->getG();
}

Profilo* User::getProfilo() const{
    return p;
}

Username* User::getUsername() const{
    return u;
}

QVector<Contatto*> User::getColl() const{
    return collegamenti;
}

QVector<Gruppo*> User::getGru() const{
    return gruppi;
}

void User::setColl(QVector<Contatto*>& x){
    collegamenti= x;
}

void User::setGru(QVector<Gruppo*>& x){
    gruppi= x;
}

void User::clearvector(){
    collegamenti.clear();
    gruppi.clear();
}

